<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <th:block th:include="include :: header('请假列表')" />
    <th:block th:include="include :: datetimepicker-css" />
    <th:block th:include="include :: bootstrap-select-css" />
</head>
<body class="gray-bg">
     <div class="container-div">
        <div class="row">
            <div class="col-sm-12 search-collapse">
                <form id="formId">
                    <div class="select-list">
                        <ul>
                            <li>
                                出差性质：<select name="leaveType">
                                    <option value="" selected>所有</option>
                                    <option value="陌拜">陌拜</option>
                                    <option value="回访">回访</option>
                                    <option value="立项">立项</option>
                                    <option value="签单">签单</option>
                                    <option value="其他">其他</option>
                                </select>
                            </li>
                            <li class="select-time">
                                <label>申请时间：</label>
                                <input type="text" class="time-input" id="startTime" placeholder="申请时间" name="params[createTime]"/>

                            </li>
                            <li>
                                <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
                                <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
                            </li>
                        </ul>
                    </div>
                </form>
            </div>

            <div class="btn-group-sm" id="toolbar" role="group">
                <a class="btn btn-success" onclick="$.operate.add()">
                    <i class="fa fa-plus"></i> 添加
                </a>
                <a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()" >
                    <i class="fa fa-remove"></i> 删除
                </a>
                <a class="btn btn-warning" onclick="$.table.exportExcel()" >
                    <i class="fa fa-download"></i> 导出
                </a>
            </div>
            <div class="col-sm-12 select-table table-striped">
                <table id="bootstrap-table"></table>
            </div>
        </div>
    </div>
    <th:block th:include="include :: footer" />
    <script th:inline="javascript">
        var prefix = ctx + "outside";

        $(function() {
            var options = {
                url: prefix + "/list",
                createUrl: prefix + "/add",
                updateUrl: prefix + "/edit/{id}",
                removeUrl: prefix + "/remove",
                exportUrl: prefix + "/export",
                modalName: "请假",
                columns: [{
                    checkbox: true
                },
                {
                    field: 'id',
                    title: '主键',
                    visible: false
                },
                {
                    field: 'sysUserName',
                    title: '出差人',

                },
                {
                    field: 'sysDeptName',
                    title: '部门'
                },
                {
                    field: 'job',
                    title: '岗位'
                },
                    {
                        field: 'planeFlagString',
                        title: '是否有工作计划',
                    },
                {
                    field: 'agreeFlagString',
                    title: '是否通过审批',

                },
                {
                    field: 'departureTime',
                    title: '预计出发时间'
                },
                {
                    field: 'returnTime',
                    title: '预计返回时间'
                },
                    {
                    field: 'evectionType',
                    title: '出差性质'
                },
                        {
                    field: 'destinationPlace',
                    title: '目的地'
                },
                    {
                        field: 'createTime',
                        title: '申请时间'
                    },
                    {
                        field: 'secondLeader',
                        title: '部门主管意见',
                        formatter: function(value, row, index) {
                            if (value == 'true'){
                                return "同意";
                            }else if (value == 'false'){
                                return "驳回";
                            }else {
                                return "暂无";
                            }
                        }
                    },
                    {
                        field: 'firstLeader',
                        title: '总经办意见',
                        formatter: function(value, row, index) {
                            if (value == 'true'){
                                return "同意";
                            }else if (value == 'false'){
                                return "驳回";
                            }else {
                                return "暂无";
                            }
                        }
                    },
                ]
            };
            $.table.init(options);
        });
    </script>
</body>
</html>